<header id="topbar">
    <div class="topbar-left">
        <ol class="breadcrumb">
            <li class="crumb-active">
                <a href="<%= window.location.href %>">整体数据概览</a>
            </li>
        </ol>
    </div>
</header>
<section id="content">
    <div class="panel">
        <div class="panel-heading">
            <span class="panel-icon"><i class="glyphicons glyphicons-table text-primary"></i>
            </span>
            <span class="panel-title">今日流水</span>
        </div>
        <div class="panel-body">
            <div id="chart_recharge"></div>
        </div>
    </div>
    <div class="panel">
        <div class="panel-heading">
            <span class="panel-icon"><i class="glyphicons glyphicons-table text-primary"></i>
            </span>
            <span class="panel-title">分段流水</span>
        </div>
        <div class="panel-body">
            <div id="chart_interval"></div>
        </div>
    </div>
    <div class="panel">
        <div class="panel-heading">
            <span class="panel-icon"><i class="glyphicons glyphicons-table text-primary"></i>
            </span>
            <span class="panel-title">用户整体数据</span>
        </div>
        <div class="panel-body">
            <table class="table table-striped fs13">
                <thead>
                    <tr class="bg-light">
                        <th></th>
                        <th>新增设备</th>
                        <th>活跃设备</th>
                        <th>注册用户</th>
                        <th>活跃用户</th>
                        <th>充值人数</th>
                        <th>充值金额</th>
                    </tr>
                </thead>
                <tbody class="admin-form">
                    <% _.each({'today': '今天', 'yesterday': '昨天', 'this_month': '本月',}, function(v, k){ %>
                        <tr>
                            <td><%= v %></td>
                            <td><%= user[k]['new_device'] || 0 %></td>
                            <td><%= user[k]['active_device'] || 0 %></td>
                            <td><%= user[k]['new_user'] || 0 %></td>
                            <td><%= user[k]['active_user'] || 0 %></td>
                            <td><%= user[k]['recharge_user'] || 0 %></td>
                            <td><%= (user[k]['recharge_price'] || 0).toFixed(2) %></td>
                        </tr>
                    <% }) %>
                </tbody>
            </table>
        </div>
    </div>
    <div class="panel">
        <div class="panel-heading">
            <span class="panel-icon"><i class="glyphicons glyphicons-table text-primary"></i>
            </span>
            <span class="panel-title">成本总体数据</span>
        </div>
        <div class="panel-body">
            <table class="table table-striped fs13">
                <thead>
                    <tr class="bg-light">
                        <th></th>
                        <th>充值金额</th>
                        <th>利润金额</th>
                        <th>利润率</th>
                    </tr>
                </thead>
                <tbody class="admin-form">
                    <% _.each({'today': '今天', 'yesterday': '昨天', 'this_month': '本月'}, function(v, k){ %>
                        <tr>
                            <td><%= v %></td>
                            <td><%= (cost[k]['recharge_price'] || 0).toFixed(2) %></td>
                            <td><%= (cost[k]['profit'] || 0).toFixed(2) %></td>
                            <td><%= cost[k]['recharge_price'] ? (cost[k]['profit'] * 100 / cost[k]['recharge_price']).toFixed(2) : 0 %>%</td>
                        </tr>
                    <% }) %>
                </tbody>
            </table>
        </div>
</section>
